package com.zgjkhis.modules.quartz.task;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zgjkhis.modules.system.domain.Drug;
import com.zgjkhis.modules.system.service.DrugService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @ClassName LogisticsTask
 * @Deacription TODO
 * @Author yzq
 * @Date 2021/7/31 15:02
 * @Version 1.0
 **/
@Slf4j
@Component
public class MothUseTask {

    @Autowired
    DrugService drugService;


    /**
     * @Author yzq
     * @Description 月使用量归0
     * @Date 2021/8/19 10:43
     * @Param []
     * @return void
     **/
    public void updateMothuse() {
        log.info(String.format(".................... task.updateMothuse start"));
//        drugWareHousingDetailService.update(Wrappers.<DrugWareHousingDetail>update().lambda().set(DrugWareHousingDetail::getMothUse,0).gt(DrugWareHousingDetail::getMothUse,0));
        drugService.update(Wrappers.<Drug>update().lambda().set(Drug::getMothUse,0).set(Drug::getMinMothUse,0).gt(Drug::getMothUse,0));
        log.info(String.format(".................... task.updateMothuse end"));
    }



}
